package com.limh.base.service

import com.limh.base.dao.Club
import com.limh.base.dao.Reply
import com.limh.base.dao.Session
import com.limh.base.dao.User
import retrofit2.http.*
import rx.Observable

/**
 * @function：
 * @author： limh
 * @date： 2018/9/24
 * Copyright @2018 Corpration Name
 */
interface Api {
    @POST("user/register/")
    fun register(@QueryMap params: Map<String, String>): Observable<Result<Session>>

    @POST("user/login/")
    fun login(@QueryMap params: Map<String, String>): Observable<Result<Session>>

    @GET("user/info/")
    fun getUserInfo(@Header("Token") token: String): Observable<Result<User>>

    @GET("reply/list")
    fun getReplys(@Query("topicId") topicId: Long?): Observable<Result<List<Reply>>>

    @POST("reply/add")
    fun addReply(@Header("Token") token: String, @QueryMap params: Map<String, String>): Observable<Result<Reply>>

    @GET("acgclub/pictures")
    fun getClubs(@Query("offset") page: Int): Observable<Result<List<Club>>>
}